GH-50578: [C++][FlightRPC][ODBC] Always return SQL_NO_DATA from GetMoreResults - #50700
Conversation
|
|
| @@ -784,11 +784,7 @@ SQLRETURN ODBCStatement::GetData(SQLSMALLINT record_number, SQLSMALLINT c_type, | |||
|
|
|||
There was a problem hiding this comment.
The CI hasn't run the C++ Extra tests, so I'm not sure whether TestSQLMoreResultsWithoutQuery will fail. If the driver manager doesn't return HY010 for SQLMoreResults, you may need to update TestSQLMoreResultsWithoutQuery to expect SQL_NO_DATA on all platforms.
arrow/cpp/src/arrow/flight/sql/odbc/tests/statement_test.cc
Lines 1986 to 1995 in deed9c0
to:
TYPED_TEST(StatementTest, TestSQLMoreResultsWithoutQuery) {
ASSERT_EQ(SQL_NO_DATA, SQLMoreResults(this->stmt));
}
edit: fixed typo
There was a problem hiding this comment.
Good catch. I pushed without the test fix to verify the test fails in CI since I don't have the tests running locally.
|
Failed successfully in https://github.com/apache/arrow/actions/runs/30479028112/job/90668568584?pr=50700#step:15:2559. Should pass with b1399a3. |
|
|
|
CI failures all look unrelated, the ODBC tests all pass so I think that's enough for this PR. This is ready for a review. |
Rationale for this change
Fixes a bug in the implementation of ODBC
GetMoreResultsin the FlightSQL ODBC driver. According to https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/statement-transitions?view=sql-server-ver17#sqlmoreresults, we should returnSQL_NO_DATAfor some states we previously were throwing another error in. This appears to be exposed by a behavior of only the Windows ODBC driver manager:GetMoreResultsalways gets called even for metadata queries.What changes are included in this PR?
GetMoreResultsnow always returnsSQL_NO_DATA.Are these changes tested?
Yes, in CI.
Are there any user-facing changes?
No.